package com.langfeiyes.pattern.builder.v2;


//可乐-饮料子类
public class Cola extends Drink {
    public static class ColaBuilder implements IBuilder{
        private String packing;    //牌子
        private String ingredient;  //配料
        private String drink;        //饮料类型

        @Override
        public ColaBuilder ingredientHandler(String ingredient) {
            this.ingredient = ingredient;
            return this;
        }
        @Override
        public ColaBuilder fillDrink(String drink) {
            this.drink = drink;
            return this;
        }
        @Override
        public ColaBuilder packing(String packing) {
            this.packing = packing;
            return this;
        }
        @Override
        public Cola build() {
            Cola cola = new Cola();
            cola.setPacking(this.packing);
            cola.setIngredient(this.ingredient);
            cola.setDrink(this.drink);
            return cola;
        }
    }
}
